<?php
$mVoucherCooker = new BAVoucherCooker();
$mPointCooker = new BAMemberPointCooker();
?>

<table class="table table-hover">
    <colgroup>
        <col class="span2">
        <col class="span6">
        <col class="span2">
    </colgroup>
    <thead>
        <tr>
            <th><?php echo '属性'; ?></th>
            <th><?php echo '内容'; ?></th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>
                <?php echo '名称'; ?>
            </td>
            <td>
                <?php
                echo CHtml::activeTextField($model, $typeNameField, array('placeholder' => '英文名' . '...', 'required' => true));
                ?>
            </td>
        </tr>
        <tr>
            <td>
                <?php echo '别名'; ?>
            </td>
            <td>
                <?php
                echo CHtml::activeTextField($model, $typeAliasField, array('placeholder' => '别名，显示名' . '...', 'required' => true));
                ?>
            </td>
        </tr>  
        <tr>
            <td>
                <?php echo '模版'; ?>
            </td>
            <td>
                <?php
                $templateData = array('0' => '选择模版');
                $templateData += $mVoucherCooker->getVoucherTypeTemplateData();

                echo CHtml::activeDropDownList($model, $templateField, $templateData, array('class' => 'span5'));
                ?>
            </td>
        </tr>
        <tr>
            <td>
                <?php echo '代金券金额（元）'; ?>
            </td>
            <td>
                <?php
                echo CHtml::activeTextField($model, $moneyField, array('placeholder' => '金额' . '...', 'required' => true));
                ?>
            </td>
        </tr>
        <tr>
            <td>
                <?php echo '有效期'; ?>
            </td>
            <td>
                <?php
                $validOptions = array(
                    'day' => '有效天数',
                    'week' => '有效星期数',
                    'month' => '有效月数'
                );
                echo CHtml::activeDropDownList($model, $validTimeUnitField, $validOptions, array('class' => 'span4'));
                echo CHtml::activeTextField($model, $validTimeLengthField, array('placeholder' => '填写数目' . '...', 'required' => true, 'class' => 'span4'));
                ?>
                <div class="text-warning">&nbsp;[申请或者领取之后的有效时间。]</div>
            </td>
        </tr>

    </tbody>
</table>

